package com.study.springsecurity.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.study.springsecurity.entity.Menu;
import com.study.springsecurity.entity.Role;
import com.study.springsecurity.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UsersMapper extends BaseMapper<UserInfo> {
    /**
     * 根据用户 Id 查询用户角色
     *
     * @param userId 用户id
     * @return
     */
    List<Role> selectRoleByUserId(@Param("userId") Long userId);

    /**
     * 根据用户 Id 查询菜单
     *
     * @param userId 用户id
     * @return
     */
    List<Menu> selectMenuByUserId(@Param("userId") Long userId);
}
